<template>
  <div class="dashboard-container">
    <div class="dashboard-text">名称: {{ name }}</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { usersinfo } from '@/api/user'
export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data(){
    return{
      name:''
    }
  },
  created() {
    this.getinfo()
  },
  methods: {
    getinfo() {
      usersinfo().then((res) => {
        console.log(res)
        this.name = res.data.name
      })

    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }

  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
